program string  
implicit none

CHARACTER *128 :: integer_string, fname
integer :: myid

myid = 10000
write(integer_string,"(I7)") myid
fname='grid/cell'//trim(adjustl(integer_string))//'.plt'
WRITE(*,*) fname
end program string  